package com.lanchetech.dao;

import com.lanchetech.bean.request.PageReq;import com.lanchetech.entity.Course;
import org.apache.ibatis.annotations.Mapper;import org.apache.ibatis.annotations.Param;import java.util.List;

@Mapper
public interface CourseMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Course record);

    int insertSelective(Course record);

    Course selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Course record);

    int updateByPrimaryKey(Course record);

    int updateDeletedById(@Param("updatedDeleted") Byte updatedDeleted, @Param("id") Long id);

    List<Course> findAllPage(PageReq req);

    List<Course> findAllListByColumnId(PageReq req);

    List<Course> findAllByColumnIdAndStatusAndDeleted(@Param("columnId") Long columnId, @Param("status") Byte status, @Param("deleted") Byte deleted);

    List<Course> findAllByIds(@Param("ids") List<Long> ids);

    List<Course> findAllByColumnIds(@Param("columnIds") List<Long> columnIds);

    Course findOneByRecommendDate(@Param("recommendDate") String recommendDate);

    Long countByColumnIdAndDeleted(@Param("columnId") Long columnId, @Param("deleted") Byte deleted);

    int addOneViewsById(@Param("id") Long id);

    int addOneGoodsById(@Param("id") Long id);

    int subOneGoodsById(@Param("id") Long id);

    int updateStudyCountById(@Param("updatedStudyCount")Long updatedStudyCount,@Param("id")Long id);

    Long sumByColumnId(@Param("columnId")Long columnId);


}